package com.aku.dao;

import com.aku.entity.Door;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DoorMapper {

    @Select("select * from tb_door")
    List<Door> selectAllDoor();

    @Select("select * from tb_door where id=#{id}")
    Door selectDoorById(int id);
    
    @Insert("insert into tb_door(name,tel,addr) values (#{name},#{tel},#{addr})")
    int insertDoor(Door door);

    @Update("update tb_door set name=#{name},tel=#{tel},addr=#{addr} where id=#{id}")
    int updateDoor(Door door);

    @Delete("delete from tb_door where id=#{id}")
    int deleteDoorById(int id);
}
